<%--
  Created by IntelliJ IDEA.
  User: zhuya
  Date: 2016/1/28
  Time: 16:45
  办事咨询 ----我的提问页面
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=utf-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no">
    <meta name="format-detection" content="telephone=no">
    <title>监管预约</title>
    <link rel="stylesheet" href="<c:url value="/resource/wechat/css/frozen.css"></c:url>">
    <link rel="stylesheet" type="text/css" href="<c:url value="/resource/wechat/css/main.css"></c:url>"/>
</head>
<body class="bg_fff" ontouchstart>
<section class="ui-container">

    <div class="jgyy_form">
        <h1>律师会见犯罪嫌疑人(被告人)预约申请表</h1>

        <form id="lshjForm" method="post">
            <div class="row mart0">
                <label>律师姓名:</label>

                <div>
                    <input type="text" name="L_name" id="lsxm"/>
                </div>

            </div>
            <div class="row">
                <label>执业证号:</label>

                <div>
                    <input type="text" name="L_zyzhm" id="zyzhm"/>
                </div>
            </div>
            <div class="row">
                <label>手机号码:</label>

                <div>
                    <input type="text" name="L_phone" id="phone"/>
                </div>
            </div>
            <div class="row">
                <label class="twoline">律师所在单位:</label>

                <div>
                    <input type="text" name="L_lsszdw" id="lsszdw"/>
                </div>
            </div>

            <div class="row">
                <label class="twoline">委托人(单位):</label>

                <div>
                    <input type="text"  name="L_wtrdw" id="wtrdw"/>
                </div>
            </div>

            <div class="row">
                <label class="twoline">委托人(单位)电话:</label>

                <div>
                    <input type="text" name="L_wtrdwdh" id="wtrdwdh"/>
                </div>
            </div>

            <h1>在押人员信息</h1>

            <%--<div class="row mart0">--%>
                <%--<label>预约编号:</label>--%>

                <%--<div>--%>
                    <%--<input type="text"/>--%>
                <%--</div>--%>
            <%--</div>--%>
            <div class="row">
                <label>姓名:</label>

                <div>
                    <input type="text"  name="L_zyname" id="xingming"/>
                </div>
            </div>
            <div class="row">
                <label>性别:</label>

                <div>
                    <input type="radio" style="margin-left: 5px;"  name="L_zyxbb" value="男" checked/> 男
                    <input type="radio" style="margin-left: 5px;"   name="L_zyxbb" value="女"/> 女
                </div>
            </div>
            <%--<div class="row">
                <label>出生年月:</label>

                <div>
                    <input type="date"  name="L_zycsny" style="height: 36px; display: block" id="birth"/>
                </div>
            </div>--%>
            <div class="row">
                <label>身份证号:</label>

                <div>
                    <input type="text" name="L_zysfzhm" id="shenfen"/>
                </div>
            </div>
            <div class="row">
                <label>在押看守所:</label>
                <div>
                    <input type="text" value="${orgName}" name="L_zykcs" readonly="readonly"/>
                </div>
            </div>
           <%-- <div class="row big">
                <label>案由:</label>
                <div>
                    <textarea name="L_zyay" id="fanzui"></textarea>
                </div>
            </div>--%>
            <div class="row">
                <label class="twoline">预约会见日期:</label>
                <div>
                    <%--<input type="date" name="L_yyhjrq" style="height: 36px; display: block" id="time"/>--%>
                    <select id="time" name="L_yyhjrq" style="height: 36px; display: block">
                        <c:forEach var="rq" items="${yyrq}">
                            <option value="${rq}">${rq}</option>
                        </c:forEach>
                    </select>
                </div>
            </div>
            <div class="row">
                <label>预约时间:</label>

                <div>
                    <input type="radio" style="margin-left: 5px;"  name="L_yysj" value="上午" checked/> 上午
                    <input type="radio" style="margin-left: 5px;"   name="L_yysj" value="下午"/> 下午
                </div>
            </div>
            <input type="hidden" name="userGuid" value="${member.guid}">
            <input type="hidden" name="caseNo" value="${caseNo}">  <%--公安提取案件编号  --%>
            <input type="hidden" name="tableName" value="Form_data_n0p79">
            <input type="hidden" name="appType"  value="5">
            <input type="hidden" name="orgId"  value="${orgId}">
            <input type="hidden" name="pt"  value="${pt}">
        </form>
        <div class="but_main">

            <%--<button class="ui-btn-lg ui-btn-danger lf50" onclick="_close()">
                关闭
            </button>--%>
            <button id="yuyue" class="ui-btn-lg ui-btn-primary lf50 marlf2" onclick="doSubmit();" style="width:96%;align:center">
                预 约
            </button>
        </div>
    </div>
</section>
<script src="<c:url value='/resource/js/jquery-2.0.min.js'/>"></script>
<script src="<c:url value="/resource/js/jquery.serializejson.min.js"></c:url>"></script>
<script>
    function _close(){
        location.href = "<c:url value='/api/case/index'/>";
    }

    function doSubmit() {
        if($("#lsxm").val() == ""){
            alert("请输入辩护律师姓名");
            return;
        }
        if($("#zyzhm").val() == ""){
            alert("请输入执业证号");
            return;
        }
        if($("#phone").val() == ""){
            alert("请输入手机号码");
            return;
        }
        if($("#lsszdw").val() == ""){
            alert("请输入律师所在单位");
            return;
        }
        if($("#wtrdw").val() == ""){
            alert("请输入委托人(单位)");
            return;
        }
        if($("#wtrdwdh").val() == ""){
            alert("请输入委托人(单位)电话");
            return;
        }
        /*if($("#danwei").val() == ""){
         alert("请输入会见人单位");
         return;
         }
         if($("#address").val() == ""){
         alert("请输入会见人家庭住址");
         return;
         }
         if($("#reason").val() == ""){
         alert("请输入会见事由");
         return;
         }*/
        if($("#xingming").val() == ""){
            alert("请输入在押人姓名");
            return;
        }
        /*if($("#birth").val() == ""){
            alert("请输入在押人出生年月");
            return;
        }*/
        if($("#shenfen").val() == ""){
            alert("请输入在押人身份证号");
            return;
        }
        if($("#yana").val() == ""){
            alert("请输入在押看守所");
            return;
        }
        /*if($("#fanzui").val() == ""){
            alert("请输入在押人案由");
            return;
        }*/
        if($("#time").val() == ""){
            alert("请输入预约会见时间");
            return;
        }
        var form = $("#lshjForm").serializeJSON();
        $("#yuyue").attr("disabled","disabled");
        $.ajax({
            url: "<c:url value="/api/project/doarrangementJg"></c:url>",
            data: JSON.stringify(form),
            type: 'post',
            contentType: "application/json",
            success: function (resp) {
                if (resp["succ"]) {
                    alert("预约已提交");
                } else {
                    $("#yuyue").attr("disabled",false);
                    alert("提交失败");
                }
            },
            error: function (resp) {
                $("#yuyue").attr("disabled",false);
                alert("提交失败,请重新操作");
            }
        });

    }
</script>
</body>
</html>
